import { request } from "@/utils/service"

// 上传文件，biz代表业务类型： "user_avatar" | "company_picture" | "user_profile" | "system_advertising"
export function uploadFile(data: FormData) {
  return request<ApiResponseData<string>>({
    url: "file/upload",
    method: "post",
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  })
}

// 将url上pdf的文件地址转化为blob数据
export function transformPdfUrlToBlobData(pdfUrl: string) {
  return request<Blob>({
    url: "file/exchange",
    method: "get",
    params: {
      pdfUrl
    },
    responseType: "blob"
  })
}
